package org.jpush.core;

import org.jpush.core.socket.JPushClientSocket;

/**
 * This class is for accepting the request of server.
 * 
 * @author Lei Wang
 *
 */
public class Acceptor extends AbstractAcceptor
{
	public Acceptor(Server serverImpl)
	{
		super(serverImpl);
	}

	protected boolean handleAcceptedSocket(JPushClientSocket clientSocket)
	{
		// Update server statics
		server.getServerStats().addToCumul(ServerStats.Measures.VisitorsSYNs, 1);

		// Send the request to handle and the function will return
		// so that next request could be handled as soon as possible.
		return server.getChannelFactory().setupClientConnection(clientSocket, this);
	}

}
